-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Issue:116, Issue:173 Verify the nav toolbar buttons[UI Tests] #10822
Issue:116, Issue:173 Verify the nav toolbar buttons[UI Tests] #10822
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10822 +/- ##
=========================================
Coverage 19.63% 19.63%
Complexity 632 632
=========================================
Files 363 363
Lines 14975 14975
Branches 2017 2017
=========================================
Hits 2940 2940
Misses 11756 11756
Partials 279 279 Continue to review full report at Codecov.
|
verifyNavURLBar() | ||
clickTabCounter() | ||
|
||
// Verify items on HomeScreen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Browser robot you should use the openHomescreen transition to go to Homescreen and then once there use its robots methods for checking that you are there, going to other menus from there...otherwise you are adding code from that robot to the BrowserRobot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah got that. So, that might be the test failure in emulator may be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, something like that 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But when function clickTabCounter()
is used it will take us to homescreen automatically. Hence, again using transition openHomeScreen
causing error as it is already taken to the homescreen on clicking the number of tabs button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I tried that, and locally is working:
verifyNavURLBar()
}.openHomeScreen {
verifyHomeScreen()
verifyExistingTabList()
}
I think the issue is in after the pressBack()
that the test does not wait enough until the website is loaded to continue.
To be sure, try adding TestAssetHelper.waitingTime
after that pressBack() if test passes, we will try to find a way to be sure the website is loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's seems you missed out adding 'clickTabCounter' function🤔
One of the steps mentioned in testrail is that one needs to click on tab counter and later check whether it's returning back to home screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't, it can go from navigation to homescreen if there is a transition defined...
https://github.com/mozilla-mobile/fenix/blob/master/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt#L338
you are tapping on tabCounter there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops,I should have gone through it carefully. Thanks for pointing out :)
I will rectify and push the code again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After pushing the code, test is failing again!
TestAssetHelper.waitingTime | ||
|
||
// Verify various items after returning back to the initial WebPage | ||
verifyPageContent(defaultWebPage.content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TejaswiKarasani I think the error you are seeing comes from this line...can you try to wait longer just to check that? if it still fails, try commenting out this line...thinking about more options here in the meantime...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other option may be to check the content in the url bar...and see if that works...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other option may be to check the content in the url bar...and see if that works...
When I saw in UI Automator, I couldn't find any specific id for the content in the url bar, I just found the whole url under one id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought it was the whole red highlight box and didn't struck my mind that it is for text inside the red box and by the way there is some particular function for testhelper.longWaitingTime or testhelper.longWaitingTime...and set time for minutes and seconds? or should I create a separate function for the long waiting time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may be able to use one off those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah cool.!
|
||
// Verify items on HomeScreen | ||
verifyHomeScreen() | ||
verifyExistingTabList() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and if I'm not mistaken, we are missing here step 6:
Back on the page, tap the menu button.
Expected Result
The main menu is displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I missed that since that text was long, I forgot to expand the excel sheet :/. Thanks for the check :)
|
||
// Verify various items after returning back to the initial WebPage | ||
verifyNavURLBar() | ||
verifyUrl((defaultWebPage.url).toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, now test is failing here, it does not find the urlBar element...it is like nothing in that page is seen when running the test...what about tryiing to add aftter line 58 this:
browserScreen { verifyNavURLBar() verifyUrl((defaultWebPage.url).toString()) }
Kind of forcing to say where you are.. and then continue with .openHomeScreen{....}
at least locally that works...worth trying...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right but change the name, is not openBrowserScreen but just browserScreen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right but change the name, is not openBrowserScreen but just browserScreen
There isn't any transition named browserScreen , I think I need to create one should I go ahead with that one? Sorry for so many follow ups :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not a transition, it is a function in BrowserRobot
Pull Request checklist
After merge
To download an APK when reviewing a PR: